package com.zw.a.basic.a05.demo09_student;

//案例: 学生类的测试类
public class StudentTest {
    public static void main(String[] args) {
        //1. 测试空参构造.
        //1.1 创建对象.
        Student s = new Student();
        //1.2 设置属性值.
        s.setName("刘亦菲");
        s.setAge(33);
        //1.3 打印属性值.
        System.out.println("姓名: " + s.getName());
        System.out.println("年龄: " + s.getAge());
        //1.4 调用方法
        s.study();
        System.out.println("-------------------");

        //2. 测试全参构造.
        //2.1 创建对象, 直接给对象的各个属性赋值.
        Student s2 = new Student("赵丽颖", 31);
        //2.2 打印属性值.
        System.out.println("姓名: " + s2.getName());
        System.out.println("年龄: " + s2.getAge());
        //2.3 调用方法
        s2.study();
    }
}
